package com.tongxin.van.frameworkcanary.utils;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.view.View;

/**
 *
 * author: VanyLiu
 * email: 13212674795@163.com
 * description:截屏工具类
 *
**/

public class ScreenshotUtils {
    //截屏
    public static Bitmap screenshot(View view){
        Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.RGB_565);
        Canvas canvas = new Canvas(bitmap);
        view.draw(canvas);
        return bitmap;
    }
}
